<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增停车费')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <input name="projects" id="projects" type="hidden" th:value="${projects}">
        <form class="form-horizontal m" id="form-parkRate-add">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">序号：</label>
                <div class="col-sm-8">
                    <input name="num" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">项目名称：</label>
                <div class="col-sm-8">
                    <input name="projectName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">单位名称：</label>
                <div class="col-sm-8">
                    <input name="unitName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">车牌号：</label>
                <div class="col-sm-8">
                    <input name="licensePlateNum" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">单价：</label>
                <div class="col-sm-8">
                    <input name="unitPrice" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label  ">起始日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="createTime" class="form-control" placeholder="请填写日期" type="text" >
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">结束日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="updateTime" class="form-control" placeholder="请填写日期" type="text" >
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <label class="radio-box"> <input type="radio"  name="status" value="0" checked/> 正常 </label>
                        <label class="radio-box"> <input type="radio"  name="status" value="1" /> 到期 </label>
                        <label class="radio-box"> <input type="radio"  name="status" value="2" /> 退租 </label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">开票时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="billingTime" class="form-control" placeholder="请填写日期" type="text" >
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">开票金额：</label>
                <div class="col-sm-8">
                    <input name="invoicedAmount" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">到账时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="paymentDate" class="form-control" placeholder="请填写日期" type="text" >
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">到账金额：</label>
                <div class="col-sm-8">
                    <input name="amountReceived" class="form-control" type="text" >
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label ">到账状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <label class="radio-box"> <input type="radio"  name="accountStatus" value="0" checked/> 已到账 </label>
                        <label class="radio-box"> <input type="radio"  name="accountStatus" value="1" /> 未到账 </label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "guomao/parkRate"

        $(function(){
            initChoice();
        })

        function initChoice(){
            $("#chooseCharge input").each(function(){
               $(this).parent().addClass("checked")
               $(this).attr("checked",true)
            });
        }


    $("#form-parkRate-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-parkRate-add').serialize());
            }
        }

        $("input[name='createTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='updateTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        $("input[name='billingTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        $("input[name='paymentDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>